Add calculated fields

The main purpose of calculated fields is to perform pre-calculations (which can be of virtually any level of complexity) over data fields. To learn how to perform simple calculations within a single data field, see Add totals to a report.

In the Report Designer, a calculated field is similar to an ordinary data field (e.g. you can bind controls to it, and group, sort and filter your report against it).

To add a calculated field to a report, follow the instructions below.

  1. To create a calculated field, in the Field List, right-click any data member, and in the menu choose Add Calculated Field.
  2. Creating a calculated field

  3. In the Field List, select the created field to show its properties in the Property Grid. Among these options, make sure to change the Field Type property to an appropriate value.
  4. Specifying the Field Type property

  5. To create an expression for the calculated field, right-click on the field within the Field List and select Edit Expression to open the Expression Editor dialog. In the dialog, click Fields to see the field list. Double-click field names to add them to the expression string.
  6. Important Known Issue: There is a limitation in the Expression Editor which inserts field names from the field list incorrectly if a name contains one or more period characters (full stops). A name such as "[X.Y.Z]" will be wrongly inserted as "[X].[Y].[Z]". To put these names into the Expression Editor you must either insert by clicking and then manually edit the name to the correct form ("X.Y.Z") or type the correct name in directly.

    Expression Editor

    Note: The fields 'SETTING.EconomicsRegime', 'SETTING.EconomicsCalculateEconomicLimit', etc. provide the capability to view Economics integration settings from within a Dataflow Report.

    To close the dialog and save the expression, click OK.

    It is also possible to use parameters in a calculated field's expression. See Add parameters.

  7. Finally, drag the calculated field from the Field List onto the required band, just like an ordinary data field.
  8. Adding the calculated field to the required band

The calculated field within the report is now ready. You can switch to the Preview tab to test the result.

Report with a calculated field